Skip to content

feat(attributes): Add cache.write attribute#292

Merged
adinauer merged 5 commits intomainfrom
feat/cache-write-attribute
Mar 26, 2026
Merged

feat(attributes): Add cache.write attribute#292
adinauer merged 5 commits intomainfrom
feat/cache-write-attribute

Conversation

@adinauer
Copy link
Member

Add cache.write boolean attribute indicating whether a cache operation resulted in a write to the cache.

Always true for unconditional writes (put, remove, clear); reflects the actual outcome for conditional operations like putIfAbsent, replace, and getAndReplace where the write may or may not occur depending on cache state.

This attribute complements the existing cache.hit attribute for read operations and is currently set by the sentry-java SDK's Spring Cache and JCache integrations.

Indicates whether a cache operation resulted in a write to the cache.
Always true for unconditional writes (put, remove, clear); reflects the
actual outcome for conditional operations (putIfAbsent, replace) where
the write may or may not occur depending on cache state.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 18, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Attributes

  • Add cache.write attribute by adinauer in #292
  • Add device context attributes by buenaflor in #300
  • Add app context attributes for mobile by buenaflor in #296
  • Add device memory and core count attributes by Lms24 in #281
  • Add ui.element.* attributes by Lms24 in #284
  • Add remaining TTFB, FCP and FP web vital attributes by Lms24 in #235
  • Add LCP web vital meta attributes by Lms24 in #233
  • Add CLS web vital source attribute by Lms24 in #234
  • Add core web web vital value attributes by Lms24 in #229
  • Add allow_any_value field to attribute schema by vgrozdanic in #272

Other

  • (http) Add http.server.request.time_in_queue attribute by dingsdax in #267
  • (resource) Add resource.deployment.environment by mjq in #266
  • Add sentry.timestamp.sequence attribute to the spec by logaretm in #262
  • Add changelog tracking to attribute definitions by ericapisani in #270

Bug Fixes 🐛

  • (attributes) Remove allow_any_value boolean attribute and allow any as type by vgrozdanic in #273
  • (gen_ai) Input and output token description by obostjancic in #261
  • (sentry) Deprecate sentry.trace.parent_span_id by mjq in #287
  • Don't run changelog generation on yarn generate by Lms24 in #277
  • Avoid changelog generation recursion by Lms24 in #274

Documentation 📚

  • (sentry) Add deprecated sentry.source by s1gr1d in #288
  • Redirect from old /generated pages to new routes by Lms24 in #291
  • Remove extra yarn run format instruction by mjq in #289
  • Update README with up-to-date links by ericapisani in #258

Internal Changes 🔧

Deps

  • Bump h3 from 1.15.5 to 1.15.9 by dependabot in #299
  • Bump devalue from 5.6.3 to 5.6.4 by dependabot in #286
  • Bump dompurify from 3.3.1 to 3.3.2 by dependabot in #278
  • Bump svgo from 3.3.2 to 3.3.3 by dependabot in #275
  • Bump svelte from 5.51.5 to 5.53.5 by dependabot in #271
  • Bump rollup from 4.40.1 to 4.59.0 by dependabot in #269
  • Bump svelte from 5.48.1 to 5.51.5 by dependabot in #260

Deps Dev

  • Bump tar from 7.5.10 to 7.5.11 by dependabot in #285
  • Bump tar from 7.5.8 to 7.5.10 by dependabot in #276
  • Bump tar from 7.5.7 to 7.5.8 by dependabot in #259

Other

  • (ai) Deprecate rest of ai.* attributes by constantinius in #264
  • (attributes) Ensure each attribute json has a changelog entry by Lms24 in #282
  • (docs) Upgrade to Astro 6 by Lms24 in #283
  • (gen_ai) Deprecate gen_ai.tool.input, gen_ai.tool.message, gen_ai.tool.output by constantinius in #265
  • (publish) Bump next entries in changelog when releasing by Lms24 in #290
  • (repo) Populate changelog property when running yarn create:attribute by Lms24 in #280
  • Pin GitHub Actions to full-length commit SHAs by joshuarli in #302
  • Wrong link to CONTRIBUTING.md in PR template by sentrivana in #298

🤖 This preview updates automatically when you update the PR.

@adinauer adinauer marked this pull request as ready for review March 23, 2026 13:45
@adinauer adinauer requested review from a team, Lms24, cleptric, lcian, mjq and nsdeschenes as code owners March 23, 2026 13:45
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from my PoV

@Lms24
Copy link
Member

Lms24 commented Mar 23, 2026

I think you need to rerun yarn generate to fix CI

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@cursor
Copy link

cursor bot commented Mar 23, 2026

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: CACHE_WRITE missing from TypeScript type map and union
    • I confirmed the omission and added CACHE_WRITE to both the TypeScript attribute type map and the attribute key union so it is recognized as a valid typed attribute.

Create PR

Or push these changes by commenting:

@cursor push 4bb83ceff8
Preview (4bb83ceff8)
diff --git a/javascript/sentry-conventions/src/attributes.ts b/javascript/sentry-conventions/src/attributes.ts
--- a/javascript/sentry-conventions/src/attributes.ts
+++ b/javascript/sentry-conventions/src/attributes.ts
@@ -10048,6 +10048,7 @@
   [CACHE_ITEM_SIZE]: 'integer',
   [CACHE_KEY]: 'string[]',
   [CACHE_OPERATION]: 'string',
+  [CACHE_WRITE]: 'boolean',
   [CACHE_TTL]: 'integer',
   [CHANNEL]: 'string',
   [CLIENT_ADDRESS]: 'string',
@@ -10524,6 +10525,7 @@
   | typeof CACHE_ITEM_SIZE
   | typeof CACHE_KEY
   | typeof CACHE_OPERATION
+  | typeof CACHE_WRITE
   | typeof CACHE_TTL
   | typeof CHANNEL
   | typeof CLIENT_ADDRESS

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

adinauer and others added 2 commits March 26, 2026 06:46
Replace hardcoded version 0.5.0 with 'next' so the version gets
assigned automatically during the release process.

Co-Authored-By: Claude <noreply@anthropic.com>
@adinauer adinauer merged commit 481cc01 into main Mar 26, 2026
12 checks passed
@adinauer adinauer deleted the feat/cache-write-attribute branch March 26, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants